package com.sp.fresh_produce.controller.dto.req;

import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 新增商品请求
 * <p>
 * 用于创建新商品时的参数验证
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ProductRequest extends BaseProductRequest {

    @NotNull(message = "商品名称不能为空")
    @Override
    public String getName() {
        return super.getName();
    }

    @NotNull(message = "商品图片不能为空")
    @Override
    public String getImage() {
        return super.getImage();
    }

    @NotNull(message = "商品分类不能为空")
    @Override
    public Integer getCategoryId() {
        return super.getCategoryId();
    }

    @NotNull(message = "商品价格不能为空")
    @Override
    public Integer getPrice() {
        return super.getPrice();
    }

    @NotNull(message = "商品库存不能为空")
    @Override
    public Integer getStock() {
        return super.getStock();
    }
}
